package com.qianguo.sender.api.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单
 *
 * @author eva
 * @date 16/5/5
 */
public class SenderOrderInfo implements Parcelable {

    public static final int SEND_STATUS_UNKNOWN = 0;
    public static final int SEND_STATUS_UNDO = 1;
    public static final int SEND_STATUS_DOING = 2;
    public static final int SEND_STATUS_FINISH = 3;


    /** 派送记录id */
    private int id;

    private String uuid;

    private String avatar;

    @JSONField(name = "shopid")
    private String shopID;

    /** 订单号 */
    private String ordersn;

    /** 下单时间 */
    @JSONField(name = "order_time")
    private String orderTime;

    /** 配送时间 */
    @JSONField(name = "delivery_time")
    private String deliveryTime;

    /** 订单总价，单位分 */
    private int price;

    /** 配送费 */
    @JSONField(name = "ps_price")
    private int deliveryPrice;

    /** 配送距离 */
    @JSONField(name = "ps_distance")
    private String deliveryDistance;

    /** 收货人姓名 */
    @JSONField(name = "receiver_name")
    private String receiverName;

    /** 收货地址 */
    @JSONField(name = "receiver_address")
    private String receiverAddress;

    /** 收货人电话 */
    @JSONField(name = "receiver_phone")
    private String receiverPhone;

    /** 收货人备注 */
    @JSONField(name = "receiver_intro")
    private String receiverIntro;

    /** 店铺名称 */
    @JSONField(name = "store_name")
    private String storeName;

    /** 店铺地址 */
    @JSONField(name = "store_address")
    private String storeAddress;

    /** 订单完成时间 */
    @JSONField(name = "order_finish_time")
    private int orderFinishTime;

    /** 付款方式，0未选择支付方式,1货到付款,2支付宝支付,3微信支付*/
    @JSONField(name = "pay_code")
    private String payCode;

    /** 付款方式中文名称,货到付款,支付宝支付,微信支付 */
    @JSONField(name = "pay_name")
    private String payName;

    /** 支付状态,0未支付,1支付成功,2支付失败 */
    @JSONField(name = "is_pay")
    private int isPay;

    /** 评价状态 */
    @JSONField(name = "is_evaluate")
    private int isEvaluate;

    /** 订单类型，立即送、按时送 */
    private int orderType;

    /** 发货状态,0未知是否要发货,1待发货,2已发货,3确认收货 */
    @JSONField(name = "send_status")
    private int sendStatus;

    @JSONField(name = "is_return")
    private int isReturn;

    @JSONField(name = "merchant_status")
    private int merchantStatus;

    @JSONField(name = "weign_status")
    private int weightStatus;

    /** 订单产品列表 */
    private List<ProductInfo> products;

    public int getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(int sendStatus) {
        this.sendStatus = sendStatus;
    }

    public int getIsReturn() {
        return isReturn;
    }

    public void setIsReturn(int isReturn) {
        this.isReturn = isReturn;
    }

    public int getMerchantStatus() {
        return merchantStatus;
    }

    public void setMerchantStatus(int merchantStatus) {
        this.merchantStatus = merchantStatus;
    }

    public int getWeightStatus() {
        return weightStatus;
    }

    public void setWeightStatus(int weightStatus) {
        this.weightStatus = weightStatus;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverAddress() {
        return receiverAddress;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public List<ProductInfo> getProducts() {
        return products;
    }

    public void setProducts(List<ProductInfo> products) {
        this.products = products;
    }


    public String getOrdersn() {
        return ordersn;
    }

    public void setOrdersn(String ordersn) {
        this.ordersn = ordersn;
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    public String getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(String deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getPayCode() {
        return payCode;
    }

    public void setPayCode(String payCode) {
        this.payCode = payCode;
    }

    public String getPayName() {
        return payName;
    }

    public void setPayName(String payName) {
        this.payName = payName;
    }

    public int getIsPay() {
        return isPay;
    }

    public void setIsPay(int isPay) {
        this.isPay = isPay;
    }

    public String getDeliveryDistance() {
        return deliveryDistance;
    }

    public void setDeliveryDistance(String deliveryDistance) {
        this.deliveryDistance = deliveryDistance;
    }

    public int getDeliveryPrice() {
        return deliveryPrice;
    }

    public void setDeliveryPrice(int deliveryPrice) {
        this.deliveryPrice = deliveryPrice;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public SenderOrderInfo() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.ordersn);
        dest.writeString(this.orderTime);
        dest.writeString(this.deliveryTime);
        dest.writeInt(this.price);
        dest.writeInt(this.deliveryPrice);
        dest.writeString(this.deliveryDistance);
        dest.writeString(this.receiverName);
        dest.writeString(this.receiverAddress);
        dest.writeString(this.payCode);
        dest.writeString(this.payName);
        dest.writeInt(this.isPay);
        dest.writeInt(this.orderType);
        dest.writeList(this.products);
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getShopID() {
        return shopID;
    }

    public void setShopID(String shopID) {
        this.shopID = shopID;
    }

    public String getReceiverPhone() {
        return receiverPhone;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public String getReceiverIntro() {
        return receiverIntro;
    }

    public void setReceiverIntro(String receiverIntro) {
        this.receiverIntro = receiverIntro;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getStoreAddress() {
        return storeAddress;
    }

    public void setStoreAddress(String storeAddress) {
        this.storeAddress = storeAddress;
    }

    public int getOrderFinishTime() {
        return orderFinishTime;
    }

    public void setOrderFinishTime(int orderFinishTime) {
        this.orderFinishTime = orderFinishTime;
    }

    public int getIsEvaluate() {
        return isEvaluate;
    }

    public void setIsEvaluate(int isEvaluate) {
        this.isEvaluate = isEvaluate;
    }

    protected SenderOrderInfo(Parcel in) {
        this.id = in.readInt();
        this.ordersn = in.readString();
        this.orderTime = in.readString();
        this.deliveryTime = in.readString();
        this.price = in.readInt();
        this.deliveryPrice = in.readInt();
        this.deliveryDistance = in.readString();
        this.receiverName = in.readString();
        this.receiverAddress = in.readString();
        this.payCode = in.readString();
        this.payName = in.readString();
        this.isPay = in.readInt();
        this.orderType = in.readInt();

        this.products = new ArrayList<ProductInfo>();
        in.readList(this.products, List.class.getClassLoader());
    }

    public static final Creator<SenderOrderInfo> CREATOR = new Creator<SenderOrderInfo>() {
        public SenderOrderInfo createFromParcel(Parcel source) {
            return new SenderOrderInfo(source);
        }

        public SenderOrderInfo[] newArray(int size) {
            return new SenderOrderInfo[size];
        }
    };
}
